﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ManageAuthor.ascx.cs"
    Inherits="NLLSite.Administrator.UserControl.ManageAuthor" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<script runat="server" language="C#">

    // We are not using a code behind page here just for simplicity in the
    // sample file. In this way we don't have to distribute a compiled DLL for
    // this page. In real cases, the following code will instead be defined in
    // a code behind file.

    protected override void OnLoad(EventArgs e)
    {
        CKFinder.FileBrowser _FileBrowser = new CKFinder.FileBrowser();
        _FileBrowser.BasePath = "../../ckfinder/";
        _FileBrowser.SetupCKEditor(CKEditor1);
    }

</script>
<div class="box box-100">
    <div class="boxin">
        <div class="header">
            <h3>
                Quản lý tác giả</h3>
        </div>
        <div style="padding: 18px;">
            <!--<form class="basic" action="" method="post" enctype="multipart/form-data"><!-- Default basic forms -->
            <div class="inner-form">
                <asp:Panel ID="Panel2" runat="server" Visible="False">
                    <table>
                        <tr>
                            <td valign="top" width="130">
                                Tên tác giả:
                            </td>
                            <td>
                                <asp:TextBox ID="txtAuthor" runat="server" Width="250px"></asp:TextBox>
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                                    ControlToValidate="txtAuthor"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" width="130">
                                Thông tin:
                            </td>
                            <td>
                                <CKEditor:CKEditorControl ID="CKEditor1" runat="server" 
                                    BasePath="../../../ckeditor/" Width="600px"></CKEditor:CKEditorControl>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" width="130">
                                &nbsp;
                            </td>
                            <td>
                                <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" width="130">
                                &nbsp;
                            </td>
                            <td>
                                <asp:Button ID="btnThem" runat="server" OnClick="btnThem_Click" Text="Lưu lại" 
                                    CssClass="altbutton" />
                                <asp:Button ID="Button2" runat="server" Text="Hủy bỏ" OnClick="Button2_Click" 
                                    CssClass="altbutton" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" width="130">
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="Panel1" runat="server">
                    <asp:CheckBox ID="cbxAll" runat="server" AutoPostBack="True" OnCheckedChanged="cbxAll_CheckedChanged" />
                    <asp:Button ID="btnXoa" runat="server" Text="Xóa" OnClick="btnXoa_Click" 
                        CssClass="altbutton" OnClientClick="javascript:return confirm('Bạn có muốn xóa?')" />
                    <asp:Button ID="Button3" runat="server" CssClass="altbutton" 
                        onclick="Button3_Click" Text="Thêm mới" />
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
                        DataKeyNames="ID" DataSourceID="LinqDataSource1" EnableModelValidation="True"
                        ForeColor="#333333" GridLines="None" Width="920px" 
                        OnSelectedIndexChanged="GridView1_SelectedIndexChanged" AllowPaging="True" 
                        AllowSorting="True">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbxDelete" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                                SortExpression="ID" Visible="False" />
                            <asp:BoundField DataField="AuthorName" HeaderText="Tác giả" SortExpression="AuthorName">
                                <HeaderStyle HorizontalAlign="Left" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Description" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField SelectText="Sửa" ShowSelectButton="True" />
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    </asp:GridView>
                    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="DAL_Class.NLLDataContext"
                        TableName="Authors">
                    </asp:LinqDataSource>
                </asp:Panel>
            </div>
        </div>
    </div>
</div>
